(* *)\r
(* (C) Copyright by Lars B. Dybdahl and others *)\r
(* E-mail: Lars@dybdahl.dk, phone +45 70201241 *)\r
-(* File version: $Date: 2005-09-28 00:33:08 $ *)\r
-(* Revision: $Revision: 1.1 $ *)\r
+(* File version: $Date: 2005-11-20 21:24:43 $ *)\r
+(* Revision: $Revision: 1.2 $ *)\r
(* *)\r
(* Contributors: Peter Thornqvist, Troy Wolbrink, *)\r
(* Frank Andreas de Groot, Igor Siticov, *)\r
{$endif}\r
{$ifdef VER120}\r
// Delphi 4\r
+ {$DEFINE DELPHI4OROLDER}\r
{$DEFINE DELPHI5OROLDER}\r
{$DEFINE DELPHI6OROLDER}\r
{$endif}\r
{$endif}\r
\r
uses\r
-{$ifdef DELPHI5OROLDER}\r
- gnugettextD4, \r
+ TypInfo,\r
+{$ifdef DELPHI4OROLDER}\r
+ gnugettextD4,\r
+{$else}\r
+ {$ifdef DELPHI5OROLDER}\r
+ gnugettextD5,\r
+ {$endif}\r
{$endif}\r
\r
{$ifdef MSWINDOWS}\r
{$else}\r
Libc,\r
{$endif}\r
- Classes, SysUtils, TypInfo;\r
+ Classes, SysUtils;\r
\r
(*****************************************************************************)\r
(* *)\r
var\r
DefaultInstance:TGnuGettextInstance;\r
\r
-// DELPHI 4\r
-\r
-function GetStrProp(Instance: TObject; const Name: string): string; overload;\r
-function GetStrProp(Instance: TObject; Info: PPropInfo): string; overload;\r
-\r
-procedure SetStrProp(Instance: TObject; const Name, Value: string); overload;\r
-procedure SetStrProp(Instance: TObject; Info: PPropInfo; const Value: string); overload;\r
-\r
implementation\r
\r
(**************************************************************************)\r
// Find TMoFile object\r
MoFilesCS.BeginWrite;\r
try\r
- idxname:=realfilename+#0+IntToStr(offset);\r
+ idxname:=realfilename+#1+IntToStr(offset);\r
if MoFiles.Find(idxname, idx) then begin\r
Result:=MoFiles.Objects[idx] as TMoFile;\r
end else begin\r
end;\r
end;\r
\r
-// DELPHI4\r
-\r
-function GetPropInfo(Instance: TObject; const Name: string; var PropInfo: TPropInfo): Boolean;\r
-var\r
- Props: PPropList;\r
- TypeData: PTypeData;\r
- Info: PPropInfo;\r
- i: Integer;\r
-begin\r
- TypeData := GetTypeData(Instance.ClassInfo);\r
- if ((TypeData <> nil) and (TypeData^.PropCount > 0)) then\r
- begin\r
- GetMem(Props, TypeData^.PropCount * sizeof(Pointer));\r
- try\r
- GetPropInfos(Instance.ClassInfo, Props);\r
- for i := 0 to TypeData.PropCount - 1 do\r
- begin\r
- Info := Props[i];\r
- if (AnsiCompareText(Info.Name, Name) = 0) then\r
- begin\r
- PropInfo := Info^;\r
- Result := True;\r
- Exit;\r
- end\r
- end;\r
- finally\r
- FreeMem(Props);\r
- end;\r
- end;\r
- Result := False;\r
-end;\r
-\r
-function GetStrProp(Instance: TObject; Info: PPropInfo): string;\r
-begin\r
- Result := TypInfo.GetStrProp(Instance, Info);\r
-end;\r
-\r
-function GetStrProp(Instance: TObject; const Name: string): string;\r
-var\r
- Info: TPropInfo;\r
-begin\r
- if GetPropInfo(Instance, Name, Info) then\r
- Result := TypInfo.GetStrProp(Instance, @Info)\r
- else\r
- Result := '';\r
-end;\r
-\r
-procedure SetStrProp(Instance: TObject; const Name, Value: string);\r
-var\r
- Info: TPropInfo;\r
-begin\r
- if GetPropInfo(Instance, Name, Info) then\r
- SetStrProp(Instance, @Info, Value);\r
-end;\r
-\r
-procedure SetStrProp(Instance: TObject; Info: PPropInfo; const Value: string);\r
-begin\r
- TypInfo.SetStrProp(Instance, Info, Value);\r
-end;\r
-\r
initialization\r
{$ifdef DXGETTEXTDEBUG}\r
{$ifdef MSWINDOWS}\r